home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / workspace.500 < prev    next >
Text File  |  1992-02-06  |  3KB  |  56 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f3\fmodern Courier;\f2\fswiss Helvetica;}
  2. \paperw11440
  3. \paperh14980
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 loginwindow .login .logout hooks\
  8. \
  9. Q:  How do you execute ~/.login, ~/.cshrc, ~/.profile, or ~/.logout without invoking Terminal, Shell, or a similar sort of shell-based terminal emulator?  Is there a hook in Workspace Manager that allows you do something when you log in or log out?\
  10. \
  11. A:  All the shell run control files (the ones mentioned above) are shell-specific.  .cshrc, .login, and .logout pertain to the C-Shell; .profile pertains to the Bourne Shell.  Only those programs examine and execute these files.  (By implication, then, if your login shell is neither csh nor sh, these files will not be executed even when you launch Terminal or Shell.)\
  12. \
  13. There is a "LoginHook" and a "LogoutHook" in 
  14. \b loginwindow
  15. \b0 .  The LoginHook is run just before loginwindow launches the specified workspace (by default, the NeXT Workspace Manager; but this can be overridden in the user's defaults database), and after account verification.  Note that the LoginHook is NOT run under the Workspace Manager, but rather is run BEFORE the Workspace Manager.  LogoutHook is run after the Workspace Manager terminates.\
  16. \
  17. To set up these hooks, type:\
  18.  
  19. \f3 \
  20.  
  21. \fs24     myhost% 
  22. \b su
  23. \b0 \
  24.     myhost# 
  25. \b dwrite loginwindow LoginHook someProgram
  26. \b0 \
  27.     myhost# 
  28. \b dwrite loginwindow LogoutHook someOtherProgram
  29. \b0 \
  30.     myhost# 
  31. \b exit
  32. \b0 \
  33.  
  34. \fs28 \
  35.  
  36. \f0  where the final argument to 
  37. \b dwrite
  38. \b0  is the name of whatever program you want to run.
  39. \b   
  40. \b0 This creates the default on a machine-by-machine basis, since the information is stored in the directory /.NeXT.  (Of course, if you have netboot clients, it need only be done on the servers of all the clients, since the root directory is shared.
  41. \b )\
  42.  
  43. \b0 \
  44. Note that neither hook is run if an automatic "me" login is performed.  The real philosophy behind the hooks is to provide additional accounting or authentication, rather than setting up the Workspace Manager's environment.  If something is required within the Workspace Manager's environment, the only real option is to have a program of your specification autolaunched from your dock.  (Yes, this will use up one of your dock slots, and it's only an option when you have an available dock slot.)\
  45. \
  46. See 
  47. \fc0 /NextLibrary/Documentation/NextAdmin/11_StartupShutdown/_ObservingTheBootProcess.rtf
  48.  for more information on loginwindow.\
  49. \
  50. QA500\
  51. \
  52. Valid for 1.0\
  53. Valid for 2.0\
  54. \
  55.  
  56.